# str = '@扎克 @俞敏洪 @马云 @马化腾'
# print('字符串“',str,'中包括'，str.count('@'),'个@符号')

# str1 = '@扎克 @俞敏洪 @马云 @马化腾'
# print('字符串“',str1,'中@符号首次出现的位置索引为:',str1.index('*'))

# str2= '@扎克 @俞敏洪 @马云 @马化腾'
# print('字符串“',str1,'中@符号首次出现的位置索引为:',str1.startswith('@'))

# str3 = 'http://www.ccit.js.cn/'
# print('字符串“',str3,'中是否以.com符号结尾，结果为'，str3.endswith('.com'))

# list_friend=['扎克伯格','俞敏洪','马云','马化腾']
# str_friend='@'.join(list_friend)
# at = '@' +str_friend
# print('您要@的好友：',at)

# verse =['春眠不觉晓','处处闻啼鸟','夜来风雨声','花落知多少']
# print(verse[2])
# print(verse[-2])

# nba = ['a','b','c','d','e','f','h','i','j','k']
# print(nba[1:5]) #bcde
# print(nba[0:5:2]) #ace

# print(nba[:])#输出全部
# print(nba[::])#输出全部
# # print(nba[]) 报错
# print(nba[0])#a
# print(nba[:1])#[a]
# print(nba[:0])#[]
# print(nba[::1])#全部


# print("2017~2018赛季NBA西部联盟前八名\n")
# team = ["a","b","c","d","e","f","g","h"]
# for index,item 


# python = set(['1','2','3','4'])
# c= set(['2','5','4','6'])
# print('选择Python语言的学生有：',python)
# print('选择c语言的有',c)
# print('交集运算',python & c)
# print('并集',python | c)
# print('差集',python - c)
# print(python +c)

# set1 = set(['1','2','3','4'])
# set1.add('貂蝉')
# print(set1)
# set1.remove('1')
# print(set1)
# set1.pop()
# print(set1)
# set1.clear()
# print(set1)

# name=['a','b','c','d']
# sign = ['1','2','3','4']
# dict = dict(zip(name,sign))
# print(dict)

# def function_tips():
#     '''功能：每天输出一条励志文字
#     '''
#     import datetime
#     mot=["坚持下去不是因为我很坚强，而是因为我别无选择",
#     "含泪播种的人一定能笑着收获",
#     "做对的事情比把事情做对重要",
#     "命运给予我们的不是失望之酒，而是机会之杯",
#     "不要等到明天，明天太遥远，今天就行动",
#     "求知若饥，虚心若愚",
#     "成功将属于那些从不说“不可能”的人"
#     ]
#     day=datetime.datetime.now().weekday()
#     print(mot[day])
#     #调用函数
#     function_tips()

# from re import S


# def F(a,b=20,*x,**y):
#     s=a+b
#     for i in x:
#         s+=i
#     for i in y.values():
#         s+=i
#     return s
# Sum = F(2,10,1,2,3,4,c=10,d=20)
# print(Sum)

# def fun_checkout(money):
#     '''功能：计算商品合计金额并进行折扣处理
#         money：保存商品金额的列表
#         返回商品的合计金额和折扣后的金额
#     '''
#     money_old = sum(money)
#     money_new = money_old
#     if 500<=money_old < 1000:
#         money_new = '{:.2f}'.format(money_old * 0.9)
#     elif 1000 <= money_old <=2000:
#         money_new = '{:.2f}'.format(money_old * 0.8)
#     elif 2000 <= money_old <=3000:
#         money_new = '{:.2f}'.format(money_old * 0.7)
#     elif money_old >=3000:
#         money_new = '{:.2f}'.format(money_old * 0.6)
#     return money_old,money_new
# #**********************调用函数**********************#
# print("\n开始结算......\n")
# list_money = []
# while True:
#     # 请不要输入非法的金额，否则将抛出异常
#     inmoney = float(input("输入商品金额(输入0表示输入完毕):"))
#     if int(inmoney)==0:
#         break
#     else:
#         list_money.append(inmoney)
# money = fun_checkout(list_money)
# print("合计金额：",money[0],"应付金额：",money[1])

#匿名函数
# import math
# from unittest import result
# def circlearea(r):
#     result = math.pi*r*r
#     return result
# r=10
# print('半径为',r,'的圆面积为：',circlearea(r))

# import math
# r =10
# result =lambda r:math.pi*r*r
# print('半径为',r,'的圆面积为：',circlearea(r))

# bookinfo = [('不一样的卡梅拉（全套）',22.50,120),('零基础学Android',65.10,89.80),('摆渡人',23.40,36.00),('福尔摩斯探案全集8册'，22.50，128)]
# print('爬取到的商品信息：\n',bookinfo,'\n')
# bookinfo.sort(key=lambda x:(x[1],x[1]/x[2]))
# print('排序后的商品信息：\n',bookinfo)

#捕获异常
# from typing import final
# from unittest import result


# def dividion():
#     '''功能：分苹果'''
#     print("\n===================分苹果了==================\n")
#     apple = int(input("请输入苹果的个数："))
#     children = int(input("请输入来了及格小朋友："))
#     if apple < children:
#         raise ValueError("苹果太少了，不够分。。。。。")
#     result = apple//children
#     remain = apple-result*children
#     if remain>0:
#         print(apple,"个苹果，平均分给",children,"个小朋友，每人分",result,"个，剩下",remain,"个。")
#     else:
#         print(apple,"个苹果，平均分给",children,"个小朋友，每人分",result,"个。")
# try:
#     dividion()
# except ZeroDivisionError:
#     print("\n出错了 ~_~ ——苹果不能被0个小朋友分！")
# except ValueError as e:
#     print("输入错误：",e)

# from dis import show_code


# class TVshow:
#     list_film = ["战狼","红海行动","西游记女儿国","熊出没","变形记"]
#     def __init__(self,shoe):
#         self.__show=show
#         @property
#         def show(self):
#             return self.__show
#         @show.setter
#         def show(self,value):
#             if value 

# tvshow = TVshow("战狼2")
# print("赈灾播放：《".tvshow.show,"》")
# print("您可以从",tvshow.list_film,"")

# class Swan:
#     '''天鹅类'''
#     _neckname_swan = '天鹅脖子很长'
#     def __init__(self):
#         print('__init__():',Swan._neckname_swan)
# wildswan = Swan()
# print('直接访问：',wildswan._neckname_swan)

# class Swan:
#     '''天鹅类'''
#     __wing_swan = '天鹅翅膀也很长'
#     def __int__(self):
#         print('__init__():',Swan.__neck_swan)
# wildswan = Swan()
# print('加入类名：',wildswan._Swan__neck_swan)
# print('直接访问：',wildswan.__neck_swan)

# class Person:
#     def _init_(self,name):
#         self.name = name
#         self._age=1
#     def set_age(self,new_age):
#         if 0<new_age<=120:
#             self._age = new_age
#     def get_age(self):
#         return self._age
# person = Person("小明")
# person.set_age(20)
# print(f"年龄为{person.get_age()}岁")

# class Cat:
#     def shout(self):
#         print("喵喵喵`")
# class Dog:
#     def shout(self):
#         print("汪汪汪！")
# def shout(obj):
#     obj.shout()
# cat =Cat
# dog=Dog
# shout(cat)
# shout(dog)

class Calculator(object):
    def _init_(self,number):
        self.number = number
    def _add_(self,other):
        self.number = self.number+other
        return self.number
    def _sub_(self,other):
        self.number = self.number - other
        return self.number
    def _mul_(self,other):
        self.number = self.number*other
        return self.number
    def _truediv_(self,other):
        self.number = self.number / other
        return self.number


calculator = Calculator(10)
print(calculator + 5)
print(calculator - 5)
print(calculator * 5)
print(calculator / 5)